import { Cascader } from 'antd';
import  area from '../../../../assets/area'
const options = area;



// const Address = () => <Cascader style={{width: '300px',marginBottom: '20px'}} options={options} onChange={onChange} placeholder="请输入大棚地址" />;


const Address = (props) => {
    
const onChange = (value) => {
    let aaa = area
    // getAddressFun = (address, area) => {
    //     return 
    if(value){
        value= value.map(item => {
           
                for (var val of aaa) {
                    if (item == val.value) {
                        aaa = val.children
                        return val.label
                    }
                }
            })
        props.aaa(value)

    }
    
};
    return (
        <Cascader style={{width: '300px',marginBottom: '20px'}} options={options} onChange={onChange} placeholder="请输入大棚地址" />
    );
}


export default Address;